﻿using System;
using System.Linq;
using System.Text;
using EntitiesLayer;
using System.Transactions;
using System.Data.SqlClient;
using System.Data;
using System.Drawing;
using System.IO;
using DAL.Repositorios;
using DAL.AbstractRepositories;


namespace DAL.Repositorios
{
    public class RepsitoryRelacionRolPermiso : AbstractRelationRepository
    {

        private void IDRelacion(long idRol, long idPermiso, string SP)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.Parameters.Add(new SqlParameter("@IdRol", idRol));
            cmd.Parameters.Add(new SqlParameter("@IdPermiso", idPermiso));
            DataSet ds = DBAccess.ExecuteSPWithDS(ref cmd, SP);

        }

        protected override void ConsultaAsignar(long idRol, long idPermiso)
        {
            IDRelacion(idRol, idPermiso, "PaRegistrarRolxPermiso");
        }

        protected override void ConsultaRemover(long idRol, long idPermiso)
        {
            IDRelacion(idRol, idPermiso, "PaEliminarRolxPermiso");
        }

        public override void RemoveAllFromKey(long id)
        {
            throw new NotImplementedException();
        }

        public override void RemoveAllFromRelated(long key)
        {
            throw new NotImplementedException();
        }
    }
}
